1. Field of the Invention
The present invention relates generally to terminal apparatuses such as printers, displays, and cash deposit devices used in automated teller machines (ATM), cash dispensers (CD), POS systems, and bank kiosks located in convenience stores, and relates more particularly to a transmission control device and transmission control method for sending data from such a terminal apparatus to a host system.
2. Description of the Related Art
ATMs, cash dispensers, POS terminals, bank kiosks, and other such systems typically have a main control device such as a personal computer (referred to below as a PC or host system) and multiple terminal devices, such as printers, display devices, cash dispensers, storage devices, and bar code readers, connected to and controlled by the host system. The host systematically controls the overall operation of the various internal terminal devices in order to achieve the desired functionality of the ATM, POS system, or other system. More specifically, the host and terminal devices are connected by a data communication line, enabling the host to send control commands and other data to the terminal devices and thereby control terminal device operation. The terminal devices send data to the host according to the terminal device function, and, when requested by the host, send a status report indicating the operating status of the terminal device to the host. Most of the terminal devices installed in the system connect to the host through a serial port (such as RS-232C) used to exchange process data and commands between the host and terminal devices.
An interface device is located between the various system components, and a control line is provided for controlling communications. A terminal device, for example, can use a data terminal ready (DTR) signal to notify the host of whether or not it is ready to receive data. When the DTR signal goes active (active state), the host sets the data set ready (DSR) signal active, and sends data after confirming that both sides are in an operating state. This makes it possible to prevent data from being dropped during data communication.
The present invention is applicable to all terminals, but to simplify the following description, it is exemplarily described as applied to a printer, which is a terminal device that is frequently used in ATMs, POS systems, and the like.
A printer typically cannot print if there is an internal shortage of any necessary printing supplies, such as printing paper or ink. It has therefore been made possible for the host to be able to confirm how much printing paper and ink remains available to the printer. More specifically, the printer is configured to send ink-near-end or paper-near-end status data to the host if the remaining printing paper or ink supply becomes low, and to send ink-end or paper-end status data if the supply is completely depleted. Various other status data may be sent to the host in addition to the above examples, including printer-cover-open, ink-tank-removed, paper-jam, and power-supply status data.
The printer may become unable to operate as a terminal (a state referred to below as being off-line) if, for example, its receive buffer becomes full (a receive-buffer-full status), a paper jams, or other error occurs such as the printer cover being open. If the printer, that is, the terminal device, goes off-line, it is necessary to notify the host of the terminal""s off-line status and interrupt, i.e. stop, the sending of data from the host to the off-line terminal.
Data is sent to the host in response to a status request command from the host, and there are different types of status request commands. To confirm a terminal device""s status, for example, the host may send a command to an individual terminal device to have the status information sent from that terminal device. Additionally, the terminal device may use a function for sending status data automatically to the host whenever there is a change in a particular status (referred to below as an Automatic Status Back (ASB) function).
A data transmission control apparatus according to the prior art is described in further detail below with reference to FIG. 8. FIG. 8 is a function block diagram showing only the major parts of a printer 70 according to the prior art. The host 90 controls the overall POS system. Though not shown in FIG. 8, numerous terminal devices such as a display device and cash drawer (not shown in the figure) required to achieve the functions of a POS system are connected to the host 90 in addition to printer 70, and the host controls these terminal devices by exchanging data with the terminal devices.
The printer 70 is controlled by sending control commands and data from the host 90 to the printer 70. A personal computer with a general purpose operating system can be used in the host 90. In order to control the printer 70, the host 90 can send a command telling the printer 70 to report its condition (status). In response to the command from the host 90, the printer 70 then sends the requested status.
The host 90 and printer 70 are connected through a serial communications port (RS-232C) driver, for example. Printer control commands and other data sent from the host 90 are received through the receive driver 71 by the receive unit 72. Received data is saved (stored) to a receive buffer (not shown in the figure) in the receive unit 72. Data saved to the receive buffer is interpreted by the command interpreter 73 in the order it was saved to the receive buffer.
The command interpreter 73 interprets and executes the commands. For example, if a print command is received the command interpreter 73 prepares the print data in a print buffer (not shown in the figure), and the data is then printed by head driver 76 and print mechanism 77 under the control of the print controller 74. A motor driver 75 handles transporting the print paper (not shown in the figure) and moving the head carriage (not shown in the figure).
A status monitor 80 is connected to a power supply voltage detector 81, paper detector 82, ink detector 83, cover detector 84, switch detector 85 for detecting paper jams, and other detectors 86, and monitors the internal condition of the printer 70. An abnormal supply voltage, the presence and amount of remaining printing paper, the presence and amount of remaining ink, whether the covers are open or closed, the occurrence of any paper jams, carriage drive errors, the receive buffer being full, and other printer conditions are detected by detectors 81 to 86 and passed to the status monitor 80.
The print status, receive buffer full status, and other status reports are also passed to the status monitor 80 by the print controller 74 and receive unit 72, for example.
When a status request command is sent from the host 90, it is passed through the receive unit 72 and interpreted by the command interpreter 73, and status information is then sent from status monitor 80 through the data transmission driver 78 to the host 90.
The status of the printer 70 is sent to the host 90 even when the ASB function is used. By first enabling the ASB function, the host 90 can be automatically informed of certain printer conditions (status), including errors, cover open status, paper position, and remaining ink quantity.
The status data may be only one byte long or may be several bytes. If it is one byte, that is, 8 bits, eight types of status data can be communicated, and as the byte count increases so does the amount of status data. A case in which ASB status data that is four bytes long is sent to the host 90 is described next.
If the ASB function is enabled and there is a change in a specified status, the status monitor 80 assembles a particular status report of four bytes and sends it through data transmission driver 78 to the host 90. Note that when starting a transmission, the terminal first checks whether the host 90 can receive data, and starts transmission if the host is not in a state in which it is unable to receive data (referred to below as a busy state).
Status data such as described above is sent sequentially to the host as communication data. Furthermore, because ASB and other status data is sent automatically to the host whenever there is a change in status, status data may be sent one after another. The problem is that this could cause the transmission buffer of the terminal device to become full (resulting in a buffer-full state), making it unable to store further information and possibly result in the loss of status data generated after the buffer becomes full.
An object of the present invention is therefore to provide a transmission control device and transmission control method enabling transmission to the host without losing status data generated continuously by the terminal device.
Another object of the present invention is to provide a status data transmission control method whereby a smaller transmission buffer can be used and the communication load can be significantly reduced.
By providing a dedicated buffer for storing continuously generated status data and storing at least the most recent status data and a status change history, and sending to the host only the most recent status data and the history of status changes leading thereto, the present invention provides a status data transmission control method able to reduce the buffer needed for transmission and greatly reduce the communication load. As a result, a history of status changes can be reliably stored and transmitted using a small amount of data.
More specifically, a transmission control device according to a first aspect of the invention has a transmission buffer for temporarily storing continuously generated status data; a dedicated buffer for temporarily storing at least the most recent status data and a history of status data change when the transmission buffer is full; a status-change history generating unit for generating history data indicating the presence of a change in status for the plural status data received continuously by the dedicated buffer; and a control means for controlling storing successive status data to the dedicated buffer when the transmission buffer becomes full, and outputting the status data stored to the dedicated buffer and the history data to the transmission buffer, and transmitting the transmission data and history data stored to the transmission buffer to an external device, when the buffer full state of the transmission buffer is cancelled.
Status changes can thus be stored using a minimal amount of data space when the transmission buffer becomes full, and the transmission load can therefore be lightened. Status data generated continuously by a terminal device can be sent to the host without loss. A smaller buffer can therefore be used for transmission, and a status data transmission control method able to greatly reduce the communication load can be provided. A status change history can also be reliably stored and sent using a minimal amount of data space. The status change history can also be sent reliably to the host without loss.
The status data stored into the dedicated buffer and for which history data is generated by the status-change history generating unit preferably consists of specific predetermined status data types. Status change history data can thus be selectively generated and sent based on importance, for example.
Further preferably, the status data represents one status with one bit, and the status-change history generating unit generates the status-change history by sequentially calculating the bitwise logical OR of the identified status bit changes in the received status data with the previously stored status data. Status change history data can thus be calculated and stored using a simple configuration.
Yet further preferably, the transmission control device also has a separate history data storage means for storing the history data, and the control means controls stores the history data to the separate history data storage means instead of to the dedicated buffer. It is thus possible to provide a separate storage means and save to the separate storage means other than the dedicated buffer.
Yet further preferably, the transmission control device also has a first dedicated buffer of a first-in, first-out (FIFO) type for storing the status data, and a second dedicated buffer for storing history data generated according to status data output from a last stage of the first dedicated buffer and the most recent status data output from the last stage of the first dedicated buffer. The status-change history generating unit generates history data based on status data output from the first dedicated buffer. The control means controls transferring status data and history data from the second dedicated buffer to the transmission buffer when the status data and history data are stored to the second dedicated buffer, and transferring the status data in the order stored from the first dedicated buffer to the transmission buffer when the status data is not stored to the second dedicated buffer.
By thus storing a specific amount of status data to the first dedicated buffer and storing status change history data when the first dedicated buffer becomes full, all status data content can be stored to the storage capacity of the first dedicated buffer.
A transmission control method according to a further aspect of the present invention has (a) a step for confirming if the transmission buffer is full, and storing continuously generated status data to the transmission buffer if the transmission buffer is not full; (b) a step for generating, when the transmission buffer is full, history data indicating the presence of a change in successive status data that cannot be stored to the transmission buffer; (c) a step for storing at least the most recent status data and the history data; and (d) a step for transferring the stored most-recent status data and the history data to the transmission buffer when the buffer full state of the transmission buffer is cancelled.
The status data processed in step (b), step (c), and step (d) preferably consists of specific predetermined status data types.
Further preferably, the status data processed in step (b), step (c), and step (d) represents one status with one bit; and step (b) for generating history data has a step for generating history data by sequentially calculating a bitwise logical OR of the continuously received status data.
A transmission control method according to a further aspect of the present invention has (a) a step for confirming if the transmission buffer is full, and storing continuously generated status data to the transmission buffer if the transmission buffer is not full; (b) a step for storing status data that cannot be stored to the transmission buffer when the transmission buffer is full to a first dedicated buffer of a first-in, first-out (FIFO) type; (c) a step for generating history data indicating presence of a status change in the status data output continuously from a last stage of the first dedicated buffer; (d) a step for storing at least the history data and most recent status data that is status data output from the last stage of the first dedicated buffer; and (e) a step for transferring status data and history data from the second dedicated buffer to the transmission buffer if the status data and history data are stored to the second dedicated buffer when the buffer full state of the transmission buffer is cancelled, and transferring the status data in the order stored from the first dedicated buffer to the transmission buffer if the status data is not stored to the second dedicated buffer.
Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.